package com.boot3.service.impl;

import com.boot3.dao.UserDao;
import com.boot3.pojo.User;
import com.boot3.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Service;

/**
 * @author wzm
 * @create 2023-11-30 10:24
 * project_name:web2310
 * @Description
 */
//@Component //交给IOC容器管理
//@Primary //让当前Bean注入
@Service  //指明加入ioc的bean是service层的对象
public class UserServiceImpl implements UserService {
    //创建dao对象
    @Autowired
    private UserDao userDao;

    @Override
    public User getUserById(Integer id) {
        //调用dao方法
        return userDao.selectUserById(id);
    }
}
